<template>
  <!-- 团购套餐卡片组件 start -->
  <div class="package_card" @click="$emit('click')">
    <div class="package_left">
      <div class="shop_logo">
        <image :src="logo_url" mode="aspectFill" class="logo_image" />
      </div>
    </div>

    <div class="package_right">
      <div class="package_title">{{ title }}</div>
      <div class="package_features">
        <span class="feature">随时退</span>
        <span class="dot">·</span>
        <span class="feature">过期退</span>
        <span class="dot">·</span>
        <span class="feature">免预约</span>
      </div>
      <div class="package_time">{{ available_time }}</div>
      <div class="package_price_row">
        <div class="price_info">
          <span class="current_price">¥{{ current_price }}</span>
          <span class="original_price">¥{{ original_price }}</span>
        </div>
        <div class="buy_button">点击购买</div>
      </div>
    </div>
  </div>
  <!-- 团购套餐卡片组件 end -->
</template>

<script>
export default {
  name: 'PackageCard',
  props: {
    logo_url: {
      type: String,
      required: true
    },
    title: {
      type: String,
      required: true
    },
    available_time: {
      type: String,
      default: '周一至周日 可用'
    },
    current_price: {
      type: [String, Number],
      required: true
    },
    original_price: {
      type: [String, Number],
      required: true
    }
  },
  emits: ['click']
}
</script>

<style lang="less" scoped>
/* 团购套餐卡片样式 */
.package_card {
  background-color: white;
  border-radius: 8px;
  padding: 20rpx;
  display: flex;

  .package_left {
    margin-right: 10px;

    .shop_logo {
      width: 60px;
      height: 60px;
      border-radius: 50%;
      background-color: white;
      border: 1px solid #f0f0f0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      overflow: hidden;

      .logo_image {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }
  }

  .package_right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;

    .package_title {
      font-size: 14px;
      font-weight: bold;
      color: #333;
      margin-bottom: 6px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .package_features {
      font-size: 12px;
      color: #666;
      margin-bottom: 4px;

      .feature {
        color: #666;
      }

      .dot {
        margin: 0 3px;
        color: #999;
      }
    }

    .package_time {
      font-size: 12px;
      color: #666;
      // margin-bottom: 8px;
    }

    .package_price_row {
      display: flex;
      justify-content: space-between;
      align-items: center;

      .price_info {
        display: flex;
        align-items: baseline;

        .current_price {
          font-size: 18px;
          font-weight: bold;
          color: #ff4d4f;
        }

        .original_price {
          font-size: 12px;
          color: #999;
          text-decoration: line-through;
          margin-left: 5px;
        }
      }

      .buy_button {
        background-color: #ff4d4f;
        color: white;
        font-size: 12px;
        padding: 6px 12px;
        border-radius: 20px;
      }
    }
  }
}
</style> 